<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=Edge">
		<title>{$pageData.title}</title>
		<link rel="stylesheet" href="__STATIC__/home/js/layui/css/layui.css" />
		<link rel="stylesheet" href="__STATIC__/home/css/admin.css" />
		<script type="text/javascript" src="__STATIC__/home/js/jquery.min.js"></script>
		<script type="text/javascript" src="__STATIC__/home/js/layui/layui.js"></script>
	</head>

	<body class="pd30" data-id="addressIndex">
		<div class="center-nav f20">{$pageData.title}</div>
		<div class="center-from b-w">
			<form class="layui-form" name="postForm" method="post" action="">
				<ul class="center-from-ul clearfix">
					<li class="width6">
						<div class="layui-form-item">
							<label class="layui-form-label">标题</label>
							<div class="layui-input-block">
								<input type="text" name="title" lay-name="标题" lay-verify="empty" autocomplete="off" placeholder="请输入标题" class="layui-input">
							</div>
						</div>
					</li>
					<li class="width6">
						<div class="layui-form-item">
							<label class="layui-form-label">姓名</label>
							<div class="layui-input-block">
								<input type="text" name="uname" lay-name="姓名" lay-verify="empty" autocomplete="off" placeholder="请输入您的收货姓名" class="layui-input">
							</div>
						</div>
					</li>
					<li>
						 <label class="layui-form-label">地区</label>
						    <div class="layui-input-inline">
						      <select id="prov" lay-filter="province">
						      
						      </select>
						    </div>
						    <div class="layui-input-inline">
						      <select id="city" lay-filter="city">
						      
						      </select>
						    </div>
						    <div class="layui-input-inline">
						      <select name="city" id="county">
						       
						      </select>
						    </div>
					</li>
					<li class="width6">
						<div class="layui-form-item">
							<label class="layui-form-label">街道地址</label>
							<div class="layui-input-block">
								<input type="text" name="address" lay-name="街道地址" lay-verify="empty" autocomplete="off" placeholder="请输入您得详细地址" class="layui-input">
							</div>
						</div>
					</li>
					<li class="width6">
						<div class="layui-form-item">
							<label class="layui-form-label">手机号码</label>
							<div class="layui-input-block">
								<input type="text" name="mphone" lay-name="手机号码" lay-verify="empty" autocomplete="off" placeholder="请输入您手机号码" class="layui-input">
							</div>
						</div>
					</li>
					<li class="width6" style="display: none;">
						<input type="text" name="token" value="{$token}">
					</li>
				</ul>
				<p class="center-from-p"><input type="button" lay-submit="submit" lay-filter="addressSubmit" class="layui-btn layui-bg-orange" value="添加地址"></p>
			</form>

		</div>
		<div class="center-nav f20" style=" padding: 20px 0;">我的银行卡</div>
		<div class="bank-list b-w">
			<table class="layui-hide" id="Table" lay-filter="TableUser"></table> 
			<script type="text/html" id="barDemo">
			  <!-- 这里的 checked 的状态只是演示 -->
			  <input type="checkbox" name="{$token}" value="{{d.id}}" title="默认地址" lay-filter="defaultDemo" {{ d.default == 1 ? 'checked' : '' }}>
			</script>
		</div>
		<script type="text/javascript">
			
			/**
			 * 设为默认银行卡
			 */
			function setDefault(id) {
				$.ajax({
					'type': 'post',
					'dataType': 'json',
					'url': "{:url('address.handle/set_default')}",
					'data': 'id=' + id + '&token={$token}',
					'success': function(data) {
						alert(data.msg);
						getBankCards();
					}
				});
			}
		</script>
		
		<script>
			//地址
			var city="{:url('api.api/city')}";      
			//添加收货地址
			var addressSrc="{:url('address.handle/add')}";
			
			//地址列表
			var addressListSrc="{:url('address.api/address')}";
			
			//设置默认地址
			var setDefault="{:url('address.handle/set_default')}";
		</script>
		<script type="text/javascript" src="__STATIC__/home/js/public.js"></script>
	</body>

</html>

<!--
address.api/details 修改地址数据展示 id
address.handle/edit 修改地址
 -->